#!/usr/bin/env python

import wx

import resource.string.menu.main as rMain
import resource.string.menu.doc as rDoc
import resource.string.menu.file as rFile
import resource.string.menu.help as rHelp
import resource.toolbar as rTool

class MenuBar(wx.MenuBar):
    '''MenuBar class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 10:47 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.MenuBar.__init__(self, *args, **kwargs)
        self.file = File()
        self.Append(self.file, rMain.file.label)
        self.doc = Document()
        self.Append(self.doc, rMain.doc.label)
        self.help = Help()
        self.Append(self.help, rMain.help.label)

class File(wx.Menu):
    '''File class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 09:54 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.close = wx.MenuItem(self, -1, rFile.quit.label, rFile.quit.help)
        self.close.Bitmap = rTool.DoorOpenOut.Bitmap
        self.AppendItem(self.close)

class Help(wx.Menu):
    '''Help class
    
    @author Julot <andy.julot@gmail.com>
    @since Thursday, February 02, 2012. 10:48 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.index = wx.MenuItem(self, -1, rHelp.index.label, rHelp.index.help)
        self.index.Bitmap = rTool.QuestionButton.Bitmap
        self.AppendItem(self.index)
        
        self.AppendSeparator()
        
        self.about = wx.MenuItem(self, -1, rHelp.about.label, rHelp.about.help)
        self.about.Bitmap = rTool.About.Bitmap
        self.AppendItem(self.about)
        
class Document(wx.Menu):
    '''Document class
    
    @author Julot <andy.julot@gmail.com>
    @since Friday, April 13, 2012. 11:51 PM'''
    
    def __init__(self, *args, **kwargs):
        wx.Menu.__init__(self, *args, **kwargs)
        
        self.browse = wx.MenuItem(self, -1, rDoc.browse.label, rDoc.browse.help)
        self.browse.Bitmap = rTool.FolderOpenImage.Bitmap
        self.AppendItem(self.browse)
        
        self.update = wx.MenuItem(self, -1, rDoc.update.label, rDoc.update.help)
        self.update.Bitmap = rTool.UploadCloud.Bitmap
        self.AppendItem(self.update)
    